﻿#include "Vector.h"

namespace math {
	vector3::vector3(double x, double y, double z) {
		this->x = x;
		this->y = y;
		this->z = z;
	}
	vector3::vector3(double* xyz) {
		if (sizeof(*xyz) / sizeof(double) != 3) {
			throw "error!";
		}
		this->x = xyz[0];
		this->y = xyz[1];
		this->z = xyz[2];
	}

	vector3 vector3::operator+(vector3 vec) {
		vector3 rtn(this->x + vec.x, this->y + vec.y, this->z + vec.z);
		return rtn;
	}
	vector3 vector3::operator-(vector3 vec) {
		vector3 rtn(this->x - vec.x, this->y - vec.y, this->z - vec.z);
		return rtn;
	}
}